<!doctype html>
<html>
    <head>
        <!-- meta -->
        <!-- meta -->
        <title>Events</title>
        <!-- css -->
        <link href="../styles/examples.css" rel="stylesheet"/>
        <link href="../../source/styles/kendo.common.css" rel="stylesheet"/>
        <link href="../../source/styles/kendo.kendo.css" rel="stylesheet"/>
        <!-- css -->
        <!-- script -->
        <script src="../js/jquery.js"></script>
        <script src="../../source/js/kendo.core.js"></script>
        <script src="../../source/js/kendo.popup.js"></script>
        <script src="../../source/js/kendo.data.js"></script>
        <script src="../../source/js/kendo.list.js"></script>
        <script src="../../source/js/kendo.autocomplete.js"></script>
        <script src="../js/kendo.console.js"></script>
        <!-- script -->
    </head>
    <body>
        <!-- nav -->
        <!-- nav -->
        <!-- description -->
        <div class="description">Events</div>
        <!-- description -->
        <div id="example" class="k-content">
            <input id="products"/>

            <script>
                $(document).ready(function() {
                    function onOpen() {
                        if ("kendoConsole" in window) {
                            kendoConsole.log("event :: open");
                        }
                    };

                    function onClose() {
                        if ("kendoConsole" in window) {
                            kendoConsole.log("event :: close");
                        }
                    };

                    function onChange() {
                        if ("kendoConsole" in window) {
                            kendoConsole.log("event :: change");
                        }
                    };

                    var data = [
                        "12 Angry Men",
                        "Il buono, il brutto, il cattivo.",
                        "Inception",
                        "One Flew Over the Cuckoo's Nest",
                        "Pulp Fiction",
                        "Schindler's List",
                        "The Dark Knight",
                        "The Godfather",
                        "The Godfather: Part II",
                        "The Shawshank Redemption"
                    ];

                    $("#products").kendoAutoComplete({
                        dataSource: data,
                        change: onChange,
                        close: onClose,
                        open: onOpen
                    });
                });
            </script>

            <div class="code-sample">
                <h4 class="code-title">Initialization Data</h4>
                <pre class="prettyprint lang-js">
var data = [
    "12 Angry Men",
    "Il buono, il brutto, il cattivo.",
    "Inception",
    "One Flew Over the Cuckoo's Nest",
    "Pulp Fiction",
    "Schindler's List",
    "The Dark Knight",
    "The Godfather",
    "The Godfather: Part II",
    "The Shawshank Redemption"
];</pre>
                </div>

                <style scoped="scoped">
                    #products {
                        margin-right: 50px;
                        float: left;
                    }

                    #example .code-sample {
                        margin-top: 0;
                        width: 300px;
                        float: right;
                    }
                </style>
        </div>
        <div class="console"></div>
        <!-- tools -->
        <!-- tools -->
    </body>
</html>
